public class BankAccount {
    //私有属性:账户余额
    private double balance;
    //构造方法
    public BankAccount(double initialBalance){
        this.balance=initialBalance;
    }
    //公共方法：存款
    public  void deposit(double amount){
        balance+=amount;
        System.out.println("Deposited:$"+amount);
        System.out.println("New balance:$"+balance);
    }
    //公共方法：取款
    public  void  withdraw(double amount){
        balance-=amount;
        System.out.println("Withdrew:$"+amount);
        System.out.println("New b");
    }
}
